package com.longge;

import java.util.ArrayList;
import java.util.List;

public class SplitWordsBySeparator {

    public List<String> splitWordsBySeparator(List<String> words, char separator) {

        ArrayList<String> ans = new ArrayList<>();

        for (String word : words) {
            String[] split = word.split(String.valueOf("\\") + separator);
            for (String s : split) {
                if (!s.equals("")) {
                    ans.add(s);
                }
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        ArrayList<String> strings = new ArrayList<>();
        strings.add("ont.sss");
        new SplitWordsBySeparator().splitWordsBySeparator(strings, '.');
    }
}
